import mongoose, { Schema, Document } from 'mongoose'

export interface ISliderDocument extends Document {
    url: string;
    _doc: ISliderDocument
}

const SliderSchema: Schema<ISliderDocument> = new Schema({
    url: String,
}, {
    timestamps: true, toJSON: {
        transform: function (_doc: any, result: any) {
            result.id = result._id
            delete result.__v
            delete result._id
            return result
        }
    }
})

export const Slider = mongoose.model<ISliderDocument>('Slider', SliderSchema)

